package com.dong.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dong.service.*;
import com.dong.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


/**
 * @author admin
 * @version 1.0.0
 * @ClassName BaseController.java
 * @Description TODO
 * @createTime 2022年05月23日 14:08:00
 */
public class BaseController {

    @Autowired
    HttpServletRequest req;

    @Autowired
    RedisUtil redisUtil;

    @Autowired
    ISysUserService sysUserService;

    @Autowired
    ISysRoleService sysRoleService;

    @Autowired
    ISysMenuService sysMenuService;

    @Autowired
    ISysUserRoleService sysUserRoleService;

    @Autowired
    ISysRoleMenuService sysRoleMenuService;

    /**
     * 获取页码
     * @return
     */
    public Page getPage(){
        int current = ServletRequestUtils.getIntParameter(req,"current",1);
        int size = ServletRequestUtils.getIntParameter(req,"size",10);

        return new Page(current,size);
    }

}
